home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / begincpp.zip / #6.C < prev    next >
Text File  |  1990-08-02  |  7KB  |  213 lines

  1. #line 1 "#6.cxx"
  2. void *_new(long);
  3. void _delete(void*);
  4. void *_vec_new(void*,int,int,void*(*)(void*));
  5. void _vec_delete(void*,int,int,void(*)(void*,int),...);
  6. void exit(int);
  7. static void cdecl _STI();
  8. static void cdecl _STD();
  9.  
  10. typedef unsigned int size_t ;
  11. typedef char *va_list ;
  12. struct _iobuf { 
  13. char *__iobuf__ptr ;
  14. int __iobuf__cnt ;
  15. char *__iobuf__base ;
  16. char __iobuf__flag ;
  17. char __iobuf__file ;} ;
  18. extern struct _iobuf _iob [];
  19. int _filbuf (struct _iobuf *);
  20. int _flsbuf (int , struct _iobuf *);
  21. void clearerr (struct _iobuf *);
  22. int fclose (struct _iobuf *);
  23. int fcloseall (void );
  24. struct _iobuf *fdopen (int , char *);
  25. int fflush (struct _iobuf *);
  26. int fgetc (struct _iobuf *);
  27. int fgetchar (void );
  28. int fgetpos (struct _iobuf *, long *);
  29. char *fgets (char *, int , struct _iobuf *);
  30. int flushall (void );
  31. struct _iobuf *fopen (char *, char *);
  32. int fprintf (struct _iobuf *, char *, ... );
  33. int fputc (int , struct _iobuf *);
  34. int fputchar (int );
  35. int fputs (char *, struct _iobuf *);
  36. size_t fread (void *, size_t , size_t , struct _iobuf *);
  37. struct _iobuf *freopen (char *, char *, struct _iobuf *);
  38. int fscanf (struct _iobuf *, char *, ... );
  39. int fsetpos (struct _iobuf *, long *);
  40. int fseek (struct _iobuf *, long , int );
  41. long ftell (struct _iobuf *);
  42. size_t fwrite (void *, size_t , size_t , struct _iobuf *);
  43. char *gets (char *);
  44. int getw (struct _iobuf *);
  45. void perror (char *);
  46. int printf (char *, ... );
  47. int puts (char *);
  48. int putw (int , struct _iobuf *);
  49. int remove (char *);
  50. int rename (char *, char *);
  51. void rewind (struct _iobuf *);
  52. int rmtmp (void );
  53. int scanf (char *, ... );
  54. void setbuf (struct _iobuf *, char *);
  55. int setvbuf (struct _iobuf *, char *, int , size_t );
  56. int sprintf (char *, char *, ... );
  57. int sscanf (char *, char *, ... );
  58. char *tempnam (char *, char *);
  59. struct _iobuf *tmpfile (void );
  60. char *tmpnam (char *);
  61. int ungetc (int , struct _iobuf *);
  62. int unlink (char *);
  63. int vfprintf (struct _iobuf *, char *, va_list );
  64. int vprintf (char *, va_list );
  65. int vsprintf (char *, char *, va_list );
  66. void *memccpy (void *, void *, int , unsigned int );
  67. void *memchr (void *, int , size_t );
  68. int memcmp (void *, void *, size_t );
  69. int memicmp (void *, void *, unsigned int );
  70. void *memcpy (void *, void *, size_t );
  71. void *memmove (void *, void *, size_t );
  72. void *memset (void *, int , size_t );
  73. void movedata (unsigned int , unsigned int , unsigned int , unsigned int , unsigned int );
  74.  
  75. char *strcat (char *, char *);
  76. char *strchr (char *, int );
  77. int strcmp (char *, char *);
  78. int strcmpi (char *, char *);
  79. int stricmp (char *, char *);
  80. char *strcpy (char *, char *);
  81. size_t strcspn (char *, char *);
  82. char *strdup (char *);
  83. char *_strerror (char *);
  84. char *strerror (int );
  85. size_t strlen (char *);
  86. char *strlwr (char *);
  87. char *strncat (char *, char *, size_t );
  88. int strncmp (char *, char *, size_t );
  89. int strnicmp (char *, char *, size_t );
  90. char *strncpy (char *, char *, size_t );
  91. char *strnset (char *, int , size_t );
  92. char *strpbrk (char *, char *);
  93. char *strrchr (char *, int );
  94. char *strrev (char *);
  95. char *strset (char *, int );
  96. size_t strspn (char *, char *);
  97. char *strstr (char *, char *);
  98. char *strtok (char *, char *);
  99. char *strupr (char *);
  100.  
  101.  
  102.  
  103.  
  104. struct student { 
  105.      int _student_pr_member ;
  106.      int _student_student_id ;
  107.      float _student_gpa ;
  108.      char _student_name [15];
  109.      char _student_college [12];
  110.      char _student_major [14];
  111.      int _student_yr ;
  112. } ;
  113. extern char *l_char (int );
  114. extern char *y_char (int );
  115.  
  116. struct grad_student { 
  117.      int _student_pr_member ;
  118.      int _student_student_id ;
  119.      float _student_gpa ;
  120.      char _student_name [15];
  121.      char _student_college [12];
  122.      char _student_major [14];
  123.      int _student_yr ;
  124.      int _grad_student_s ;
  125.      char _grad_student_dept [15];
  126.      char _grad_student_thesis [50];
  127. } ;
  128. extern char *s_char (int );
  129.  
  130. void proc1 (struct student *);
  131. void proc2 (struct grad_student *);
  132.  
  133. int main ()
  134.   { 
  135.      struct student _au1_s1 ;
  136.      struct grad_student _au1_gs1 ;
  137.  
  138.      ( ( ( ((& _au1_s1 )-> _student_pr_member = 0), 0 ) , 
  139.           ( ((& _au1_s1 )-> _student_student_id = 100 ), 
  140.           ( ((& _au1_s1 )-> _student_gpa = ((float )2.99 )), 
  141.           (((& _au1_s1 )))) ) ) ) ;
  142.  
  143.      ( ( (( ( ( ((((struct student *)
  144.           (& _au1_gs1 )))-> _student_pr_member = 0), 0 ) , 
  145.           ( ((((struct student *)(& _au1_gs1 )))-> _student_student_id = 200 ),
  146.           ( ((((struct student *)(& _au1_gs1 )))-> _student_gpa 
  147.           = ((float )3.01 )), (((((struct student *)(& _au1_gs1 )))))) ) ) ) ),
  148.           ( ((& _au1_gs1 )-> _grad_student_s = 0), (((& _au1_gs1 )))) ) ) ;
  149.  
  150.      proc1 ( (struct student *)(& _au1_s1 )) ;
  151.  
  152.      ( printf ( (char *)"%-15s %-15s %4d %-12s %-14s %-9s %4.2f\n", 
  153.           l_char ( (& _au1_s1 )-> _student_pr_member ) , 
  154.           (& _au1_s1 )-> _student_name , (& _au1_s1 )-> _student_student_id , 
  155.           (& _au1_s1 )-> _student_college , (& _au1_s1 )-> _student_major , 
  156.           y_char ( (& _au1_s1 )-> _student_yr ) , 
  157.           (& _au1_s1 )-> _student_gpa ) ) ;
  158.  
  159.      proc2 ( (struct grad_student *)(& _au1_gs1 )) ;
  160.  
  161.      ( printf ( (char *)"%-15s%-10s %-50s\n", 
  162.           (& _au1_gs1 )-> _grad_student_dept , 
  163.           s_char ( (& _au1_gs1 )-> _grad_student_s ) , 
  164.           (& _au1_gs1 )-> _grad_student_thesis ) ) ;
  165.   }  
  166.   exit ( 0 ); 
  167. }
  168.  
  169. extern void proc1 (struct student *_au0_sp )
  170.      strcpy ( (*_au0_sp ). _student_name , (char *)"Loope deLoop") ;
  171.      strcpy ( (*_au0_sp ). _student_college , (char *)"Art&Science") ;
  172.      strcpy ( (*_au0_sp ). _student_major , (char *)"French") ;
  173.      (*_au0_sp ). _student_yr = 3;
  174.  
  175. extern void proc2 (struct grad_student *_au0_gsp )
  176.      strcpy ( (*_au0_gsp ). _student_name , (char *)"Yogi Bear") ;
  177.      strcpy ( (*_au0_gsp ). _grad_student_dept , (char *)"Entertainment") ;
  178.      strcpy ( (*_au0_gsp ). _student_college , (char *)"Business") ;
  179.      strcpy ( (*_au0_gsp ). _grad_student_thesis , (char *)"10000 ways to be smarter than the average bears") ;
  180.      strcpy ( (*_au0_gsp ). _student_major , (char *)"") ;
  181.  
  182. extern char *l_char (int _au0_l )
  183.      switch (_au0_l ){ 
  184.           case 0: return "Undergraduate";
  185.           case 1: return "Graduate";
  186.      } 
  187. extern char *y_char (int _au0_yr )
  188.      switch (_au0_yr ) { 
  189.           case 0: return "Freshman";
  190.           case 1: return "Sophomore";
  191.           case 2: return "Junior";
  192.           case 3: return "Senior";
  193.      } 
  194. extern char *s_char (int _au0_s )
  195.      switch (_au0_s ) { 
  196.           case 0: return "Ta";
  197.           case 1: return "Ra";
  198.           case 2: return "Fellowship";
  199.           case 3: return "Other";
  200.      } 
  201. }
  202.  
  203.